<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>common_util: src/common_util/timecount.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">common_util<span id="projectnumber">&#160;1.1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_2961cad218251a7c35c6867350b80887.html">common_util</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">timecount.h</div></div>
</div><!--header-->
<div class="contents">
<a href="timecount_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span><span class="preprocessor">#include &lt;cstdint&gt;</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span><span class="preprocessor">#include &lt;atomic&gt;</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span><span class="keyword">namespace </span>cutl</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span>{</div>
<div class="foldopen" id="foldopen00035" data-start="{" data-end="};">
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="classcutl_1_1timecount.html">   35</a></span>    <span class="keyword">class </span><a class="code hl_class" href="classcutl_1_1timecount.html">timecount</a></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>    {</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="classcutl_1_1timecount.html#a35e56757510b5610d9f2caf1cbeeed2b">   43</a></span>        <a class="code hl_function" href="classcutl_1_1timecount.html#a35e56757510b5610d9f2caf1cbeeed2b">timecount</a>(<span class="keyword">const</span> std::string &amp;func_name);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="classcutl_1_1timecount.html#a5cfc1c14487a423757be606e3388fde1">   48</a></span>        <a class="code hl_function" href="classcutl_1_1timecount.html#a5cfc1c14487a423757be606e3388fde1">~timecount</a>();</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span> </div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span>    <span class="keyword">private</span>:</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>        std::string func_name_;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span>        std::atomic&lt;uint64_t&gt; start_time_;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span>    };</div>
</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span>} <span class="comment">// namespace</span></div>
<div class="ttc" id="aclasscutl_1_1timecount_html"><div class="ttname"><a href="classcutl_1_1timecount.html">cutl::timecount</a></div><div class="ttdoc">A simple time counter class to measure the execution time of a function.</div><div class="ttdef"><b>Definition</b> timecount.h:36</div></div>
<div class="ttc" id="aclasscutl_1_1timecount_html_a35e56757510b5610d9f2caf1cbeeed2b"><div class="ttname"><a href="classcutl_1_1timecount.html#a35e56757510b5610d9f2caf1cbeeed2b">cutl::timecount::timecount</a></div><div class="ttdeci">timecount(const std::string &amp;func_name)</div><div class="ttdoc">Construct a new timecount object The constructor will record the begin time of the function calling.</div></div>
<div class="ttc" id="aclasscutl_1_1timecount_html_a5cfc1c14487a423757be606e3388fde1"><div class="ttname"><a href="classcutl_1_1timecount.html#a5cfc1c14487a423757be606e3388fde1">cutl::timecount::~timecount</a></div><div class="ttdeci">~timecount()</div><div class="ttdoc">Destroy the timecount object The desctructor will record the end time of the function calling and cal...</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>
